

<div class="xinxi-guanli">
<div class="xinxi-title">
	<ul id="details-ul" class="clearfix">
		<li><a title="供求管理"  href="/product/index">管理供求信息</a></li>
		<li class="hover"><a title="发布供应信息" href="javascript:void(0);">发布供应信息</a></li>
		<li><a href="/product/buy">发布采购信息</a></li>
	</ul>
</div>
 <div id="details-con-1" class="xinxi-guanli-box">
<form id="applyform" action="/product/supply" method="post" onsubmit="return checkadd();">

<table class="grinfo">

  <tbody>
	<tr>
		<th><span class="red">*</span>分类栏目：</th>
		<td colspan="2">
		<select id="catid" class="inp inw" style="width:80px;" name="catid">
		{$Categoryhtml}
		</select>
		<span id="typeidhtml">
		<select id="typeid" class="inp inw" style="width:105px;" name="typeid">
		<option value="0">选择子分类</option>
		</select>
		</span>
		</td>
	</tr>

	<tr>
		<th><span class="red">*</span>发货地址：</th>
		<td colspan="2">
		<select id="areaid" class="inp inw" style="width:140px;" name="areaid">
		{$Areahtml}
		</select>
		<span id="aidhtml">
		<select id="aid" class="inp inw" style="width:100px;" name="aid">
		<option value="0">选择省市</option>
		</select>
		</span>
		</td>
	</tr>

	
	<tr>
		<th><span class="red">*</span>信息标题：</th>
		<td><input type="text" value="" id="title" style="width:450px;" name="title" class="inp inw"></td>
	</tr>
	
	<tr>
		<th><span class="red">*</span>关键词：</th>
		<td><input type="text" value="" id="keywords" style="width:450px;" name="keywords" class="inp inw"></td>
	</tr>


	

	<tr>
		<th><span class="red">*</span>价格：</th>
		<td colspan="2">
			<input type="text" name="price" id="price" value="" style="width:60px;"  maxlength="30" class="inp"> 元 (0元表示面议)&nbsp;&nbsp;&nbsp;&nbsp;<span class="red">*</span><span style="font-size:14px">计量单位：</span>
			<select id="unit" class="inp inw" style="width:80px;" name="unit">
					<option value="0">手动填写</option>
					<option value="1">平方米</option>
					<option value="2">立方米</option>
					<option value="3">件</option>
					<option value="4">个</option>
					<option value="5">套</option>
					<option value="7">米</option>
					<option value="8">吨</option>
					<option value="11">袋</option>
					<option value="12">桶</option>
			</select>
			<span id="unithtml">
			<input type="text" name="unitname" style="width:80px;"  id="unitname" value="" maxlength="30" class="inp"> (没有我想要的计量单位，请手动填写)
			</span>
		</td>
	</tr>

	
	<tr>
		<th><span class="red">*</span>发货周期：</th>
		<td colspan="2">
			<input type="text" name="cycle" id="cycle" value="30"  style="width:60px;"  maxlength="30" class="inp"> 天(填写的数字为1至365的天数范围内)&nbsp;&nbsp;&nbsp;&nbsp;<span class="red">*</span><span style="font-size:14px">信息有效期：</span>
			<select id="valid" class="inp inw" style="width:80px;" name="valid">
		<option value="1">一年内</option>
		<option value="2">六个月内</option>
		<option value="3">三个月内</option>
		<option value="4">一个月内</option>
		</select>
		</td>
	</tr>

	<tr>
		<th><span class="red">*</span>最小起订量：</th>
		<td colspan="2">
			<input type="text" name="least" id="least" style="width:60px;" value="" class="inp inw"> (0表示不限)&nbsp;&nbsp;&nbsp;&nbsp;<span class="red">*</span><span style="font-size:14px">供货总量：</span>
			<input type="text" name="total" id="total" style="width:270px;" value="" class="inp inw"> (文字在20个字以内)
			
		</td>
	</tr>


	
	
	

	<tr>
		<th valign="top"><span class="red">*</span>产品介绍：</th>
		<td>
			<textarea name="content" class="grtextarea" style="width:505px;height:280px;" id="productContent"> </textarea>
			<span id="txtSignContent_Tip">产品介绍文字不能少于30个字</span>
		</td>
	</tr>

	<tr>
				    <th>产品图片：</th>
					<td>
                        <div class="upload_img_area" >
							<ul id="picturelist" class="clearfix"></ul>
							 <input type="hidden" name="nowpicnums" id="nowpicnums" value="0" >
						</div>
						<br/>
						<div style="float:left;">
                            <div id="filePictures"></div>
                            <div id="uploadpicture">
                                <span id="images" name="images" ></span>
                            </div> 
                        </div>
						<br/>
						<br/>

						<p class="f_prompt"><i class="icon i_s_plaint"></i>注意：可一次选择多张图片批量上传。请上传3-5张清晰无水印截图的！特别提醒：【<b>正视角的图片上传效果会更好!</b>】</p>
                    </td>
    </tr>
	


	
	<tr>
		<th>品牌：</th>
		<td colspan="2">
			<input type="text" name="brands" id="brands" style="width:450px;" value=""  class="inp inw">
			<span id="txtAddress_Tip"></span>
		</td>
	</tr>
	<tr>
		<th>型号：</th>
		<td>
			<input type="text" name="type" id="type" style="width:450px;" value=""  class="inp inw">
		</td>
	</tr>

	<tr>
		<th>规格：</th>
		<td>
			<input type="text" name="standard" id="standard" style="width:450px;" value="" class="inp inw">
		</td>
	</tr>
	
	
	
	
	<tr>
		<th valign="top">摘要：</th>
		<td>
			<textarea name="description" class="grtextarea" style="width:455px;height:80px;" id="description"> </textarea>
			<br>
			<span class="fgrey">(250字符以内)</span>
		</td>
	</tr>
	
	
	
	
	<tr>
		<th>&nbsp;</th>
		<td colspan="2">
			<label id="butt" class="butt">
				<input type="submit" name="btnSubmit" value="发布完成" id="btnSubmit" class="btns">
			</label>
		</td>
	</tr>
</tbody>
</table>

{__TOKEN__}
</form>

  </div>
  
    
</div>

<script type="text/javascript" src="/public/js/plugin/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript" src="/public/js/plugin/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="/public/js/plugin/layer/jquery.layer.js"></script>
<script type="text/javascript" src="/public/js/soft.js"></script>
<script type="text/javascript">
function checkadd()
{
	var introstr = tinyMCE.get('productContent').getContent();
    $("#productContent").val(introstr);
}

//选取文件的函数，后台特有
tinymce.init({
    selector: "textarea#productContent",
    theme: "modern",
	language :"zh_CN",
    width: 600,
    height: 300,
    plugins: [
         "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
         "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
         "save table contextmenu directionality emoticons template paste textcolor"
   ],
   content_css: "css/content.css",
   toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons", 
   style_formats: [
        {title: 'Bold text', inline: 'b'},
        {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
        {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
        {title: 'Example 1', inline: 'span', classes: 'example1'},
        {title: 'Example 2', inline: 'span', classes: 'example2'},
        {title: 'Table styles'},
        {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
    ]
 });   

$(document).ready(function(){
	
	

	$("#catid").bind("change", function(){
		var pid = $(this).val();
		
		$.post('/ajax/category',{pid:pid},function(result){
			$("#typeidhtml").html(result.data);
		});
	});

	$("#areaid").bind("change", function(){
		var pid = $(this).val();
		
		$.post('/ajax/area',{pid:pid},function(result){
			$("#aidhtml").html(result.data);
		});
	});

	$("#unit").bind("change", function(){
		var unit = $(this).val();
		if(unit>0){
			$("#unithtml").hide();
		}else{
			$("#unithtml").show();
		}
		
	});


	


	

	$("#images").uploadify({
			swf              : '/public/js/plugin/uploadify.swf',
			uploader         : "/public/upload",
			cancelImg        : '/public/images/cancel.gif',
			formData      : {'uid' : '3551726'},
			removeTimeout    : 0,
			debug    : true,
			queueID          : 'filePictures',
			method		     : 'POST',
			fileTypeDesc     : '注意:您只能上传jpeg,png,gif,zip格式的文件!',
			fileTypeExts     : '*.jpg;*.jpeg;*.gif;*.png',
			buttonImage	     : '/public/images/upload_file.png',
			width		     : '100',
			height		     : '35',	
			auto             : true,
			multi            : true,
			onUploadSuccess  : function(file, data, response) {
					var response=eval("("+data+")");
					
					if(response.status){
						var picnum = $("#nowpicnums").val();
						var str='<li id=picnum'+picnum+'>'+response.data.head+'<a class="icon del_ico" onclick="delimages(this,'+picnum+')">删除</a>\
						<br>'+response.data.end+'<em class="radio_icon" ></em>\
						<span class="mr10">封面</span>&nbsp;&nbsp;&nbsp;&nbsp;\
						<span title="上一个" onclick="PrevImage('+picnum+')" class="icon ico_prev">上一个</span>\
						<span title="下一个" onclick="NextImage('+picnum+')" class="icon ico_next">下一个</span>\
						</div></li>';
						$('#picturelist').append(str);
						$("#filePictures").html('');
						$('#msg_pic').html('');
						$("#nowpicnums").val(parseInt(parseInt(picnum)+1));
					} else {
						$.layer({v_title:'出错提示',v_msg:response.info,v_shade:false,v_btns:1,v_area:['410px','220px']});
				}
				 
		  },
		  onUploadStart : function(file) {
			  var imgsize = $("#picturelist").find("img").size();
			  if(parseInt(imgsize)>=6){
				  $.layer({
						v_msg:'对不起，您只能上传最多6张图片!',
						v_shade:false,
						v_title:'图片超过',
						v_btns:1,
						v_btn:['确定'],
						v_showtime:2
				});
				$('#images').uploadify('disable', true);
				$('#images').uploadify('stop');
				$('#images').uploadify('cancel');
			  }
			  
		  }, 
		  onQueueComplete : function(queueData) {
				showButton();
		  } 
	});


		
 });	
 </script>